package cvc.framework.controller;

import cvc.framework.entity.WebSocketMessage;
import cvc.framework.result.RestMessage;
import cvc.framework.result.RestResult;
import cvc.framework.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/Log")
public class LogController {
    @Autowired
    LogService logService;

    //获取所有日志信息
    @PostMapping(value = "/getLogs")
    public RestResult getLogs(@RequestBody WebSocketMessage message) {
        RestResult res = new RestResult();
        res.message = new RestMessage();
        res.message.data = logService.getLogs(message);
        return res;
    }

}
